//
//  DetailTableViewCell.m
//  DayByDay
//
//  Created by dllo on 16/5/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "DetailTableViewCell.h"
#define DETAILCELLWIDTH self.contentView.frame.size.width;
#define DETAILCELLHEIGHT self.contentView.frame.size.height;

@interface DetailTableViewCell ()

@property (nonatomic, strong)UILabel *songNameLabel;
@property (nonatomic, strong)UILabel *songerNameLabel;

@end

@implementation DetailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)setModel:(PosterDetailSongsModel *)model {
    _model = model;
    NSString *string = [NSString stringWithFormat:@"%@%@",_model.name, _model.alias];
    self.songNameLabel.text = string;
    self.songerNameLabel.text = _model.singerName;
    
}

- (void)createView {
    self.numberLabel = [UILabel new];
    [self.contentView addSubview:self.numberLabel];
    self.songNameLabel = [UILabel new];
    [self.contentView addSubview:self.songNameLabel];
    self.songerNameLabel = [UILabel new];
    [self.contentView addSubview:self.songerNameLabel];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.backgroundColor = [UIColor clearColor];
    self.numberLabel.frame = CGRectMake(10, 5,  40, 40);
    self.songNameLabel.frame = CGRectMake(60, 5, WIDTH - 100, 20);
    self.songerNameLabel.frame = CGRectMake(60, 30, WIDTH - 100, 20);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
